import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  { path:'/',
redirect:'/login'},
  {
    path: '/login',
    name: '登录页',
    component: ()=> import ('@/views/Login')
  },
  {
    path: '/home',
    name: '体育新闻主页',
    redirect:'/home/homepage',
    component: () => import(/* webpackChunkName: "about" */ '../views/Home'),
    children:[
      {
        path:'/home/match',
        name:'赛事页面',
        redirect:'/home/match/nba',
        component:()=> import('../views/Home/match'),
        children:[
          {
            path:'/home/match/nba',
            name:'NBA',
            component:() => import('../views/Home/match/NBA')
          },
          {
            path:'/home/match/Beijinggames',
            name:'北京冬奥会',
            component:() => import('../views/Home/match/Beijinggames')
          },
          {
            path:'/home/match/chinafootball',
            name:'中国足球',
            component:() => import('../views/Home/match/ChinaFootball')
          },
          {
            path:'/home/match/nationnalfootball',
            name:'国际足球',
            component:() => import('../views/Home/match/Nationnalfootball')
          },
        ]
      },
      {
        path:'/home/user',
        name:'用户界面',
        component:()=>import('@/views/Home/user')
      },
      {
        path:'/home/homepage',
        name:'主页',
        component:()=>import('@/views/Home/homepage')
      }
    ]
  },
  {
    path:'/detail',
    name:'赛事详情',
    component:() => import('../views/Home/detail')
  },
  {
    path:'*',
    component:()=>import('@/views/error')
  }
]

const router = new VueRouter({
  mode:'history',
  routes
})

export default router
